package com.base.core.producer.autoconfigure;


import com.base.core.producer.broker.ProducerClient;
import com.base.core.producer.broker.RabbitBroker;
import com.base.core.producer.broker.RabbitBrokerImpl;
import com.base.core.producer.broker.RabbitTemplateConatiner;
import com.base.core.producer.service.MessageStoreService;
import com.base.core.task.annotation.EnableElasticJob;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;

/**
 * 自动装配
 * 自动装配的前提是@Configuration
 */
@EnableElasticJob
@Configuration
@ComponentScan("com.base.core.producer.*")
public class RabbitProducerAutoConfiguration {
//
//    /**
//     * 消息存储
//     * @return
//     */
//    @Bean
//    public MessageStoreService messageStoreService() {
//        return new MessageStoreService();
//    }
//
//
//    /**
//     * rabbitTemplateContainer容器
//     * @param messageStoreService
//     * @return
//     */
//    @Bean
//    public RabbitTemplateConatiner rabbitTemplateContainer(MessageStoreService messageStoreService) {
//        return new RabbitTemplateConatiner(messageStoreService);
//    }
//
//
//    /**
//     * 消息发送rabbitRoker
//     * rabbitBroker
//     * @param rabbitTemplateConatiner
//     * @param messageStoreService
//     * @return
//     */
//    @Bean
//    public RabbitBroker rabbitBroker(RabbitTemplateConatiner rabbitTemplateConatiner,MessageStoreService messageStoreService){
//        return new RabbitBrokerImpl(rabbitTemplateConatiner,messageStoreService);
//    }
//
//
//    /**
//     * 发送客户端
//     * @param rabbitBroker
//     * @return
//     */
//    @Bean
//    public ProducerClient producerClient(RabbitBroker rabbitBroker){
//        return new ProducerClient(rabbitBroker);
//    }



}
